import { http } from '@/api'
import {
  IjiaoyanguizeType,
  IjiaoyanguizeDetailType,
  IsuccessTypeAPI,
  IgetDetailTypeAPI,
  IgetListAPI
} from '@/type/modules/equipment/jiaoyanguize'

// 查询列表
export const getListAPI = (data: IjiaoyanguizeType) => {
  return http<IgetListAPI>('GET', '/equipment/jiaoyanguize/list', data)
}
// 查询所有列表
export const getAllListAPI = (data: any) => {
  return http('POST', '/equipment/jiaoyanguize/all-list', data)
}

// 删除
export function delAPI(ids: string) {
  return http<IsuccessTypeAPI>('DELETE', '/equipment/jiaoyanguize/' + ids)
}
// 按照设备名称删除校验规则
export function delBatchAPI(data: any) {
  return http<IsuccessTypeAPI>('POST', '/equipment/jiaoyanguize/device/',data)
}

// 新增
export const addAPI = (data: IjiaoyanguizeDetailType) => {
  return http<IsuccessTypeAPI>('POST', '/equipment/jiaoyanguize', data)
}
// 批量新增
export const addBatchAPI = (data: any) => {
  return http<IsuccessTypeAPI>('POST', '/equipment/jiaoyanguize/batch', data)
}

// 获取详细数据
export const getDetailAPI = (id: number) => {
  return http<IgetDetailTypeAPI>('GET', '/equipment/jiaoyanguize/detail/' + id)
}

// 修改
export const putAPI = (data: IjiaoyanguizeDetailType) => {
  return http<IsuccessTypeAPI>('PUT', '/equipment/jiaoyanguize', data)
}